package ldh.im.fxgui.rpc.service;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

public enum DataSubTypeEnum {
    groupName("group", "g_ed_name", "editGroupName"),
    groupDesc("group", "g_ed_desc", "editGroupDescription"),

    sessionDisturb("session", "s_ed_disturb", "editSessionDisturb"),
    sessionTop("session", "s_ed_top", "editSessionTop"),

    groupUserName("groupUser", "gu_ed_userName", "editGroupUserName"),
    ;

    private String group;
    private String subType;
    private String methodName;

    private DataSubTypeEnum(String group, String subType, String methodName) {
        this.group = group;
        this.subType = subType;
        this.methodName = methodName;
    }

    public static List<DataSubTypeEnum> groups(String group) {
        return Arrays.stream(DataSubTypeEnum.values()).filter((e)->e.group.equals(group)).collect(Collectors.toList());
    }

    public String getGroup() {
        return group;
    }

    public String getSubType() {
        return subType;
    }

    public String getMethodName() {
        return methodName;
    }
}
